package com.raph;

import com.raph.server.Server;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Scanner;

//TIP 要<b>运行</b>代码，请按 <shortcut actionId="Run"/> 或
// 点击装订区域中的 <icon src="AllIcons.Actions.Execute"/> 图标。
public class Main {
    private static final Logger logger = LoggerFactory.getLogger(Main.class);

    public static void main(String[] args) {
        new Thread(()->{
            while(true) {
                Scanner scanner = new Scanner(System.in);
                String input = scanner.next();
                if("/shutdown".equals(input)){
                    Server.shutDown();
                    System.exit(0);
                    break;
                }
                else{
                    logger.info("未知命令");
                }
            }
        }).start();
        new Server();
    }
}